package com.sunxu.springboot.demo.controller;

import com.sunxu.springboot.demo.pojo.User;
import com.sunxu.springboot.demo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author 孙许
 * @date 2018-08-13
 * @description
 */
@Controller
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService service;

    @RequestMapping("/getUser")
    @ResponseBody
    public User getUser(Integer id) {
        return service.getUser(id);
    }
}
